/**********************************************************************************
// GameObject Header File
//
// Creation:	01 Oct 2007
// Updated:		27 Mai 2011
// Compiler:	Visual Studio 2010
//
// Notes:		Base class for every game object.
//				A game object is anything that we may want to render or interact 
//              with in the game. For instance, a game object can be an unit, 
//              a building, a projectile, a texture or even an event trapper.
//
**********************************************************************************/

#ifndef _ANABELE_GAMEOBJECT_H_
#define _ANABELE_GAMEOBJECT_H_

/**********************************************************************************/
// make classes and functions exportable to a DLL
#ifdef ANABELE_EXPORTS
#define DLL __declspec( dllexport ) 
#else
#define DLL __declspec( dllimport )
#endif

/**********************************************************************************/

#include "Types.h"			// using engine custom types

/**********************************************************************************/

class DLL GameObject
{
public:
	float x, y;				// world coordinates of the object
	uint  type;				// type of the object
	uint  customType;		// customizable type for the object

public:
	GameObject();			// default constructor

	int  IntX() const;		// get integer representation of x coordinate
	int  IntY() const;		// get integer representation of y coordinate
	
	// virtual functions: 
	// can be overwriten in the derived classes
	virtual void Translate(float dx, float dy);				// move the object by delta				
	virtual void MoveTo(float px, float py);				// move the object to coordinates
	virtual void MoveTo(int px, int py);					// move the object to coordinates
		
	// pure virtual funcions: 
	// must be overwriten in the derived classes
	virtual void Rotate(float angle) = 0;					// rotate the geometry by the given angle
	virtual void Scale(float xScale, float yScale) = 0;		// scale the geometry by the given factors
	virtual void Draw() = 0;								// draw the game object on screen
}; 

/**********************************************************************************/
// InLine Member Functions

inline GameObject::GameObject()				// default constructor
{ x = y = 0.0f; type = customType = 0; }		

inline int GameObject::IntX() const			// get integer representation of x coordinate
{ return int(x); }

inline int GameObject::IntY() const    		// get integer representation of y coordinate
{ return int(y); }

inline void GameObject::Translate(float dx, float dy)	// move the object by delta				
{ x += dx; y += dy; }

inline void GameObject::MoveTo(float px, float py)		// move the object to coordinates
{ x = px; y = py; }

inline void GameObject::MoveTo(int px, int py)			// move the object to coordinates
{ x = float(px); y = float(py); }

/**********************************************************************************/

#endif


